<template>
  <div>

    <el-form>
      <el-form-item>
        <el-input v-model="form.phone" />
      </el-form-item>
      <el-form-item>
        <el-input v-model="form.password" />
      </el-form-item>
      <el-form-item>
        <el-input v-model="form.code" />
        <img :src="baseUrl+'/captcha?type=login&ttt='+num" alt="" @click="num=Date.now()">
      </el-form-item>
    </el-form>
    <el-button @click="submit">登录</el-button>

  </div>
</template>
<script>
import axios from 'axios'
const _axios2 = axios.create({
  baseURL: process.env.VUE_APP_URL2
})
export default {
  data() {
    return {
      num: Date.now(),
      baseUrl: process.env.VUE_APP_URL2,
      form: {
        phone: '', //	是	string	手机号
        password: '', //	是	string	密码
        code: '' //	是	string	验证码
      }
    }
  },
  methods: {
    async submit() {
      const res = await _axios2({
        url: '/login',
        method: 'post',
        data: this.form
      })
      console.log('登录', res)
    }
  }

}
</script>
<style>
</style>
